//
//  GSAboutViewController.m
//  GameSky
//
//  Created by lanou on 16/1/21.
//  Copyright © 2016年 NiRongfei. All rights reserved.
//

#import "GSAboutViewController.h"
#import "GSPeopleViewController.h"
#import "GSBussinessViewController.h"

@interface GSAboutViewController ()

@property (nonatomic, strong)GSPeopleViewController *peopleVC;

@property (nonatomic, strong)GSBussinessViewController *bussinessVC;
@end

@implementation GSAboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake((kScreenWidth - 120) / 2  , (kScreenWidth - 120) / 2 , 120, 120)];
    
    imageV.image = [UIImage imageNamed:@"AppIcon60x60@3x"];
    
    imageV.layer.cornerRadius = 20;
    
    imageV.clipsToBounds = YES;
    
    [self.view addSubview:imageV];
    
    GSBorderButton *people = [GSBorderButton buttonWithType:(UIButtonTypeCustom)];
    
    people.frame = CGRectMake(imageV.left, imageV.bottom + 20, 120, 40);
    
    [people setTitle:@"人才招聘" forState:(UIControlStateNormal)];
    
    [people setTitleColor:kRGBColor(0.53, 0.53, 0.53) forState:(UIControlStateNormal)];
    
    [people addTarget:self action:@selector(peopleClick:) forControlEvents:(UIControlEventTouchUpInside)];
    
    [self.view addSubview:people];
    
    
    GSBorderButton *business = [GSBorderButton buttonWithType:(UIButtonTypeCustom)];
    
    business.frame = CGRectMake(imageV.left, people.bottom + 20, 120, 40);
    
    [business setTitle:@"商务合作" forState:(UIControlStateNormal)];
    
    [business setTitleColor:kRGBColor(0.53, 0.53, 0.53) forState:(UIControlStateNormal)];
    
    [business addTarget:self action:@selector(businessClick:) forControlEvents:(UIControlEventTouchUpInside)];
    
    [self.view addSubview:business];
    
    UILabel *version = [[UILabel alloc]initWithFrame:CGRectMake(business.left, business.bottom + 30, business.width, business.height)];
   
    version.textAlignment = NSTextAlignmentCenter;
    
    version.text = @"2.1.0";
   
    version.textColor = kRGBColor(0.53, 0.53, 0.53);
    
    [self.view addSubview:version];

    
}

- (void)peopleClick:(UIButton *)button
{
    
    self.peopleVC = [[GSPeopleViewController alloc]init];
    
    
    self.peopleVC.view.frame = CGRectMake(kScreenWidth, 0, kScreenWidth, kScreenHeight);
    
    
    [[UIApplication sharedApplication].keyWindow addSubview:self.peopleVC.view];
    
    
    [UIView animateWithDuration:0.5 animations:^{
        
        self.peopleVC.view.transform = CGAffineTransformTranslate(self.peopleVC.view.transform, -kScreenWidth, 0);
        
    }];
}

- (void)businessClick:(UIButton *)button
{
    
    self.bussinessVC = [[GSBussinessViewController alloc]init];
    
    
    self.bussinessVC.view.frame = CGRectMake(kScreenWidth, 0, kScreenWidth, kScreenHeight);
    
    
    [[UIApplication sharedApplication].keyWindow addSubview:self.bussinessVC.view];
    
    
    [UIView animateWithDuration:0.5 animations:^{
        
        self.bussinessVC.view.transform = CGAffineTransformTranslate(self.bussinessVC.view.transform, -kScreenWidth, 0);
        
    }];
}



@end
